<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'frontend.main.class.php');
$feObj = new FrontendMainBase();

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'module/news/news.class.php');
$mObj = new NewsBase();
$mObj->format = true;

//
if( $request_link_class == '' ) {
	$mObj->setQueryLimitLength(20);
	$items = $mObj->getItems('', 0);
	
	$feObj->content_wrap['items'] = $items;
} else {
	$item = $mObj->getItem($request_link_class, 'link');
	
	$feObj->content_wrap['item'] = $item;
	$feObj->content_wrap['mainpart'] = 'item';
}

//
$mObj->setQueryLimitLength(8);
$news_items = $mObj->cache('getItems', array('', 0));
$feObj->content_wrap['lc_news_items'] = $news_items;

//
echo $feObj->display('pagelayout/pagelayout_main_news.tpl');
//
?>